/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package graph;

import java.awt.Color;
import java.io.Serializable;
import java.util.ArrayList;

/**
 *
 * @author borysfan
 */
public class Edge implements Serializable {
    private int id;
    private String name="No name";
    private Node start;
    private Node end;
    private double vmax=50;
    private double length=1;
    private boolean lock=false;
    private String notes="notes";
    private ArrayList<EdgeEvent> events;
    private int weatherconditions=0;
    private int roadconditions=0;
    private int traffic=0;
    private Color color = Color.black;
    private Color defcolor = Color.black;
    private int weatherslider=50;
    private int roadslider=50;

    private boolean visited = false;
   

    public Edge(){
        events = new ArrayList<EdgeEvent>();
    }

    public Edge( Node from, Node target){
        events = new ArrayList<EdgeEvent>();
        this.start = from;
        this.end = target;
    }

    ///////////////////////// gettery i settery

    public int getId(){
        return id;
    }

    public String getName(){
        return name;
    }

    public Node getEnd(){
        return end;
    }


    public boolean isLock(){
        return lock;
    }

    public double getLength(){
        return length;
    }

    public double getVMax(){
        return vmax;
    }


    public void setName(String s){
        this.name = s;
    }


    public void setId(int i){
        id = i;
    }

    public void setEnd(Node n){
        this.end = n;
    }


    public void setLength(double d){
        length = d;
    }

    public void setVMax(double d){
        vmax = d;
    }

    public void lock(){
        lock=true;
    }

    public void unlock(){
        lock = false;
    }

    public String getNotes(){
        return notes;
    }

    public void setLock(boolean lock){
        this.lock=lock;
    }
    public void setNotes(String v){
        notes = v;
    }

   

    public void addEvent(EdgeEvent ev){
        events.add(ev);
    }

    public void removeEdge(EdgeEvent ev){
        events.remove(ev);
    }

    public int getTraffic(){
        return traffic;
    }

    public void setTraffic(int traffic){
        this.traffic=traffic;
    }

    public int getRoadConditions(){
        return roadconditions;
    }

    public void setRoadConditions(int roadconditions){
        this.roadconditions=roadconditions;
    }

    public int getWeatherConditions(){
        return weatherconditions;
    }

    public void setWeatherConditions(int weatherconditions){
        this.weatherconditions=weatherconditions;
    }

    public Color getDefColor() {
        return this.defcolor;
    }

    public void setDefColor(Color c){
        defcolor = c;
    }

    @Override
    public String toString(){
        return new String("["+start.getName()+":"+end.getName()+"]");
    }

    public Node getStart() {
        return start;
    }

    public void setColor(Color c) {
        color = c;
    }

    public Color getColor(){
        return color;
    }

    public boolean isVisited() {
        return visited;
    }

    public void setVisited(boolean flag){
        visited = flag;
    }

    public void setRoadSlider(int roadslider){
        this.roadslider=roadslider;
    }

    public int getRoadSlider(){
        return roadslider;
    }

    public void setWeatherSlider(int weather){
        this.weatherslider=weather;
    }

    public int getWeatherSlider(){
        return weatherslider;
    }

    
}
